<?php

namespace App\Http\Resources;

use Illuminate\Http\Resources\Json\Resource;

class UserResource extends Resource
{
    /**
     * Transform the resource into an array.
     *
     * @param  \Illuminate\Http\Request  $request
     * @return array
     */
    public function toArray($request)
    {
        return [
            'id' => (int)$this->id,
            'name' => (string)$this->name,
            'username' => (string)$this->username,
            'type' => (string)$this->type,
            'password' => (string)$this->password,
            'sex' => (string)$this->sex,
            'school_id' => (string)$this->school_id
        ];
    }
}
